﻿package com.bigstar.lolkor;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

public class MenualSelectDialog extends Dialog implements OnClickListener {
	private Context context;
	private int champ_id;
	public MenualSelectDialog(Context context, int champ_id) {
		super(context);
		this.context = context;
		this.champ_id = champ_id;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
		setContentView(R.layout.menual_select);
		Button b = (Button)this.findViewById(R.id.champ_info_btn);
		b.setOnClickListener(this);
		b = (Button)this.findViewById(R.id.champ_menual_btn);
		b.setOnClickListener(this);
		b = (Button)this.findViewById(R.id.champ_counter_btn);
		b.setOnClickListener(this);
		b = (Button)this.findViewById(R.id.champ_gallery_btn);
		b.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		Intent intent;
		switch(v.getId()){
		case R.id.champ_info_btn:
    		intent = new Intent(context, Champion.class);
			intent.putExtra("champId", ""+champ_id);
			context.startActivity(intent);
			break;
		case R.id.champ_menual_btn:
    		intent = new Intent(context, ServerStatus.class);
			intent.putExtra("champid", ""+champ_id);
			intent.putExtra("menual", "yes");
			context.startActivity(intent);
			break;
		case R.id.champ_counter_btn:
			intent = new Intent(context, ServerStatus.class);
			intent.putExtra("champid", ""+champ_id);
			intent.putExtra("counter", "yes");
			context.startActivity(intent);
			break;
		case R.id.champ_gallery_btn:
			intent = new Intent(context, ChampionGallery.class);
			intent.putExtra("champ_id", ""+champ_id);
			context.startActivity(intent);
			break;
		}
		dismiss();
	}
	

}
